﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    /// <summary>
    ///  室内状况勘察表
    /// </summary>
   public class IndoorDal:BaseDal<Model.EAIndoor>
    {
        public override string tablename
        {
            get { return "EAIndoor"; }
        }

        public override Dictionary<string, bool> PKName
        {
            get
            {

                Dictionary<string, bool> dic = new Dictionary<string, bool>();
                dic.Add("Indoor_Id", true);
                return dic;
            }
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="t">实体对象</param>
        /// <returns>bool类型 true为添加成功，false为添加失败</returns>
        public bool IndoorAdd(Model.EAIndoor e)
        {
            string sql = @"insert into EAIndoor(projectNumber,indoor_Purpose,indoor_LayerNum, indoor_Layer,indoor_Orientation,indoor_Residence,indoor_Bedroom,indoor_Hall,indoor_Toilet, indoor_Kitchen,
indoor_Balcony,indoor_Terrace,indoor_Yard,indoor_RoomDegree,indoor_ToiletDegree,indoor_KitchenDegree,indoor_HallDegree,indoor_Explain,living_Wall,livingWall_Other,
living_Ceiling,livingCeiling_Other,living_Ground,livingGround_Other,room_Wall,roomWall_Other,room_Ceiling,roomCeiling_Other,room_Ground,roomGround_Other,
toilet_Wall,toiletWall_Other,toilet_Ceiling,toiletCeiling_Other,toilet_Ground,toiletGround_Other,toilet_Sanitary,toiletSanitary_Other,kitchen_Wall,kitchenWall_Other,
kitchen_Ceiling,kitchenCeiling_Other,kitchen_Ground,kitchenGround_Other,kitchen_Cooking,kitchenCookingO_ther,Indoor_CreateTime,Indoor_CreatePeople)
values('"+e.projectNumber+"',"+e.indoor_Purpose+","+e.indoor_LayerNum+","+e.indoor_Layer+","+e.indoor_Orientation+","+e.indoor_Residence+",'"+e.indoor_Bedroom+"','"+e.indoor_Hall+"','"+e.indoor_Toilet+"','"+e.indoor_Kitchen+"','"+e.indoor_Balcony+"','"+e.indoor_Terrace+"','"+e.indoor_Yard+"',"+e.indoor_RoomDegree+","+e.indoor_ToiletDegree+","+e.indoor_KitchenDegree+",'"+e.indoor_HallDegree+"','"+e.indoor_Explain+"','"+e.living_Wall+"','"+e.livingWall_Other+"','"+e.living_Ceiling+"','"+e.livingCeiling_Other+"','"+e.living_Ground+"','"+e.livingGround_Other+"','"+e.room_Wall+"','"+e.roomWall_Other+"','"+e.room_Ceiling+"','"+e.roomCeiling_Other+"','"+e.room_Ground+"','"+e.roomGround_Other+"','"+e.toilet_Wall+"','"+e.toiletWall_Other+"','"+e.toilet_Ceiling+"','"+e.toiletCeiling_Other+"','"+e.toilet_Ground+"','"+e.toiletGround_Other+"','"+e.toilet_Sanitary+"','"+e.toiletSanitary_Other+"','"+e.kitchen_Wall+"','"+e.kitchenWall_Other+"','"+e.kitchen_Ceiling+"','"+e.kitchenCeiling_Other+"','"+e.kitchen_Ground+"','"+e.kitchenGround_Other+"','"+e.kitchen_Cooking+"','"+e.kitchenCookingO_ther+"',GETDATE(),'小黑')";
            return Common.DBHelp.GetExecuteNonQuery(sql);
        }
    }
}
